'''
处理子标签和后代标签
'''
from urllib.request import urlopen
from bs4 import BeautifulSoup

html = urlopen("https://www.douban.com/gallery/")
bsObj = BeautifulSoup(html, "html.parser")

childList = bsObj.find("ul", {"class": "topics"}).children
for x in childList:
    print(x)

descendantsList = bsObj.find("div", {"class": "nav-items"}).descendants
for y in descendantsList:
    print(y)
